package top.csjss.hospital.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import top.csjss.hospital.service.DoctorService;
import top.csjss.hospital.service.ReportService;
import top.csjss.hospital.vo.R;

import java.util.List;
import java.util.Map;

/**
 * @Author ztf
 * @Date 21:38 2021/10/19
 **/
@RestController
public class MainController {
    @Autowired
    private DoctorService doctorService;
    @Autowired
    private ReportService reportService;

    /**
     * 排班信息表
     * @param week
     * @return
     */
    @PostMapping("/main/paiban/{week}")
    public List<Map<String,Object>> scheduler(@PathVariable String week){

        //调用service
        List<Map<String,Object>> result=doctorService.findSchedulerByWeek(week);

        return result;
    }

    /**
     * 门诊总人数
     * @return
     */
    @PostMapping("/main/Total")
    public Integer reportTotal(){
        Integer count = reportService.findReportCountTotal();
        return count;
    }

    /**
     * 今日门诊人数
     * @return
     */
    @PostMapping("/main/currentNum")
    public Integer reportCurrent(){
        Integer count = reportService.findReportCountCurrent();
        return count;
    }
}
